package com.ren.mianshi.http2.retrofit;


import com.ren.mianshi.constant.AppConfig;
import com.ren.mianshi.http.retrofit.RRetrofitClient;
import com.ren.mianshi.http2.retrofit.interceptor.HandlerInterceptor;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Retrofit业务请求控制类
 * Created by ren on 2017/9/5.
 */

//@RetrofitService(apiServices = {UserApiService.class, ParkApiService.class, InspectApiService.class, PrintApiService.class})
public class AppRetrofitClient extends RRetrofitClient {


    public AppRetrofitClient() {
        retrofit = new Retrofit.Builder()
                .baseUrl(AppConfig.HTTP_BASE_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .client(createOkHttpClient())
                .build();
    }

    @Override
    protected OkHttpClient createOkHttpClient() {
        return newDefaultOkHttpClient(false,new HandlerInterceptor());
    }
}
